package utils

import "strings"

func HostActiveStateToFloat(state string) float64 {
	if strings.Contains(state, "YES") {
		return 1
	} else if strings.Contains(state, "NO") {
		return 2
	}
	return 0
}

func DiskStateToFloat(state string) float64 {
	if strings.Contains(state, "Enabled") {
		return 1
	} else if strings.Contains(state, "Unbound") {
		return 2
	}
	return 0
}

func PortStatusToFloat(status string) float64 {
	if strings.Contains(status, "Online") {
		return 1
	} else if strings.Contains(status, "DISABLED") {
		return 2
	}
	return 0
}

func CrusStateToFloat(state string) float64 {
	if strings.Contains(state, "Present") {
		return 1
	}
	return 2
}

func SPFaultLedToFloat(faultLed string) float64 {
	if strings.Contains(faultLed, "OFF") {
		return 1
	} else if strings.Contains(faultLed, "ON") {
		return 2
	}
	return 0
}

func LunStateToFloat(state string) float64 {
	if strings.Contains(state, "Bound") {
		return 1
	}
	return 2
}
